vector differentiation